package com.cq.ssm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.cq.ssm.mapper.TitletypeMapper;
import com.cq.ssm.po.Titletype;
import com.cq.ssm.service.TitletypeService;

@Component("titletypeService")
public class TitletypeServiceImpl implements TitletypeService {

	@Autowired
	private TitletypeMapper pm;
	// 插入一条记录
	public boolean insertTitletype(Titletype titletype) throws Exception {
		int i = pm.insertSelective(titletype);
		return i==1?true:false;
	}

	// 根据id删除一条记录
	public boolean deleteById(Integer id) throws Exception {
		int i = pm.deleteByPrimaryKey(id);
		return i==1?true:false;
	}

	// 查询所有记录
	public List<Titletype> findAll() throws Exception {
		return pm.selectAllTitletype();
	}
}
